<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
		<div class="pageNav" >
		
				<b>共<span  class='text-primary'>${pageBean.pageCount}</span>页 当前 <span class='text-primary'>${pageBean.pageNow}</span>页</b>
				<%--上一页 --%>
				<c:choose>
					<c:when test="${pageBean.pageNow eq 1 }">
							<a class="pageNum">&lt;上一页</a>
					</c:when>
					<c:otherwise>
							<a href="${pageBean.url}&pageSize=${pageBean.pageSize}&pageNow=${pageBean.pageNow-1 }" class="pageNum">&lt;上一页</a>
					</c:otherwise>
				</c:choose>
				<c:choose>
					<c:when test="${pageBean.pageCount <= 6 }">
						<c:set var="begin" value="1" />
						<c:set var="end" value="${pageBean.pageCount }" />
					</c:when>
					<c:otherwise>
						<c:set var="begin" value="${pageBean.pageNow-2 }" />
						<c:set var="end" value="${pageBean.pageNow + 3}" />
						<c:if test="${begin < 1 }">
							<c:set var="begin" value="1" />
							<c:set var="end" value="6" />
						</c:if>
						<c:if test="${end > pageBean.pageCount }">
							<c:set var="begin" value="${pageBean.pageCount-5 }" />
							<c:set var="end" value="${pageBean.pageCount }" />
						</c:if>
					</c:otherwise>
				</c:choose>

				<c:if test="${pageBean.pageNow >3 }">
					<a class="pageNum" href="${pageBean.url}&pageSize=${pageBean.pageSize}&pageNow=1" >首页</a> 
				</c:if>
				<c:forEach begin="${begin }" end="${end }" var="i">
					<c:choose>
						<c:when test="${i eq pageBean.pageNow }">
							<b>${i }</b><!-- 当前页 -->
						</c:when>
						<c:otherwise>
						<a class="pageNum"   href="${pageBean.url}&pageSize=${pageBean.pageSize}&pageNow=${i }">${i }</a>
						</c:otherwise>
					</c:choose>
				</c:forEach>
				<c:if test="${end < pageBean.pageCount }">
				<a class="pageNum" href="${pageBean.url}&pageNow=${pageBean.pageCount }&pageSize=${pageBean.pageSize}" >尾页</a> 
				</c:if>
				<%--下一页 --%>
				<c:choose>
					<c:when test="${pageBean.pageNow eq pageBean.pageCount }">
							<a class="pageNum">下一页&gt;</a>
					</c:when>
					<c:otherwise>
						<a class="pageNum" href="${pageBean.url}&pageNow=${pageBean.pageNow+1 }&pageSize=${pageBean.pageSize}">下一页&gt;</a>
					</c:otherwise>
				</c:choose>
</div>	